package com.yxq.sso.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * @author YXQ
 * @date 2021/12/2 15:25
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MenuVo implements Serializable ,Comparable {
    /**
     * 菜单的编号
     */
    private Long id;

    /**
     * 菜单的父菜单的编号
     */
    private Long pid;

    /**
     * 菜单的名字
     */
    private String name;

    /**
     * 菜单的链接url，前端参数用的path
     */
    private String path;

    /**
     * 菜单的图标,前端要求给菜单的图标
     */
    private String icon;

    /**
     * 当前菜单的子菜单，
     */
    private List<MenuVo> childrenMenu;

    @Override
    public int compareTo(Object o) {
        MenuVo o1 = (MenuVo) o;
        Long l = this.getId() - o1.getId();
        return Integer.parseInt(l.toString());
    }
}
